<?php
	require($_SERVER["DOCUMENT_ROOT"]."/modules/security_mod.php");
	require($_SERVER["DOCUMENT_ROOT"]."/modules/hack_mod.php");
	
	//$acc = SecurityMod::checkHackerLogin();
	//if (is_null($acc)) {
        //	echo("Invalid credentials");
	//      print "invalid credentials";
        //	exit;
	//}

	$acc = SecurityMod::checkLogin();
	if (is_null($acc)) {
		echo("Invalid credentials");
		print "invalid credentials";
		exit;
	}

	$res = HackMod::addHack($acc->getUniverse(), stripslashes($_REQUEST["data"]));
	if ($res)
		echo("Ok");
	else
		echo("Internal error");
?>